﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ARS.Control.Custom.Entity.Forms
{
    public class KindEditorForm:Form
    {
        protected override void RenderContents(System.Web.UI.HtmlTextWriter output)
        {
            base.RenderContents(output);
            StringBuilder sb = new StringBuilder();
            sb.Append("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/kindeditor/kindeditor-min.js\"></script>");
            sb.Append("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/kindeditor/lang/zh_CN.js\"></script>");
            sb.Append("<link href=\"/Scripts/kindeditor/themes/default/default.css\" rel=\"stylesheet\" type=\"text/css\" />");
            sb.Append(string.Format("<textarea name=\"{0}\" style=\"width:800px;height:400px;visibility:hidden;\"></textarea><script type=\"text/javascript\">alert(1);var editor;$(function(){{ KindEditor.ready(function (K) {{editor = K.create('textarea[name=\"{0}\"]', {{allowFileManager: true}});}}); }})</script>", base.Field.Html_Control_Name));
            //sb.Append(
               // ARS.PublicTool.WebHelper.WebPage.ScriptHelper.GetScriptStr(
                  //  string.Format("var editor;KindEditor.ready(function (K) {editor = K.create('textarea[name=\"{0}\"]', {{allowFileManager: true}});});",base.Field.Html_Control_Name)));
            output.Write(string.Format(base.GetTrHtml(), sb));

        }
    }
}
